<?php
     if(isset($_COOKIE["user"]))
     {
        echo"<script> alert('Another user is currently logged in. Please log out before you can activate your account');</script>";
              echo("<script> document.location.href('account.php'); </script>");
    }
    
     require('db_connection.php');
    $query ="SELECT * FROM tbllibrary";
    $result = mysql_query($query);
?>

<!doctype html public "-//W3C//DTD HTML 4.01//EN">

<html>

   <head>
      <title>La Union Online Library System -- Home</title>
      <meta http-equiv='generator' content='PHP Designer 2005' />
      <style type="text/css">
        @import url(style.css);
      </style>
   </head>
   <body>
        <table  width='80%' align='center' >
            <tr ><td class='outerframe'>
                <table width='100%'>
                <tr>
                    <td width='100%' colspan='2' >
                    <table width='100%'><tr>
                   <img src ='images/banner.jpg'></td></tr>
                <tr>
                    <td colspan='2' class='outerframe2'><?php require('loginout.php'); ?></td></tr>
                <tr>
                    <td width='20%' class='menu' valign='top'><?php require('menu.php'); ?></td>
                    <td class='content' width='80%' background ='images/background.jpg'>
                        <p class='titles' align='top'>Account Activation</p>

                        <form method='post' action='activate_account.php'>
                        <table>
                            <tr>
                                <td>Library card number:</td>
                                <td><input name='libraryid'/></td></tr>
                            <tr>
                            
                                <td>Location:</td>
                                <td> <select name='location'>
                                <?php  while ($row = mysql_fetch_array($result))
                                    {
                                        $libraryNo = $row['libraryNo'];
                                        $location = $row['libraryName'];
                                        echo"<option value=$libraryNo>"." $location "." ";
                                    } ?> </tr>
                            <tr>
                                <td>Password:</td>
                                <td ><input type='password' name='password1'> </tr>
                            <tr>
                                <td>Re-type Password:</td>
                                <td ><input type='password' name='password2'>
                                </td></tr>
                            <tr>
                                <td colspan='2'align='center'><input type='submit' value='ACTIVATE' class='tool'></td></tr>

                            
                        </table>
                        </form></td></tr>
                <tr>
                <td colspan='2' class='outerframe2'><?php require('contact.php'); ?></td></tr>
                </table>
        </td></tr></table>
    </body>
</html>

